
#ifndef __PARTITIONER_HPP__
#define __PARTITIONER_HPP__ 1

#include <iostream> 
#include <fstream>
#include <sstream>
#include <vector>
#include <list>

using namespace std; 

class Partition
{
private: 
  string strbuf; 
  stringstream stream;
  
public:
  Partition(char *buffer, int len);
  Partition(string *); 
  string getBuffer();
}; 


class Partitioner
{
  static const int chunkSize = 4096;
private:
  char *buffer; 
  string delim; 
  list<string> files; 
  FILE *f; 

  void openNextFile(); 

public:
  Partitioner(list<string> files);
  ~Partitioner(); 
  Partition* getPartition(); 
  bool hasPartitions();
  void setDelim(string delim); 
}; 

#endif 
